package 力扣._00周赛._146双周赛.问题1;

class Solution {
    public int countSubarrays(int[] nums) {
        int count = 0;
        for(int i=0;i < nums.length -2;i++){
            if((nums[i]+nums[i+2])*2 == nums[i+1])
                count++;
        }
        return count;
    }
}